Skip to content

Some cleanup of C++ support and fix GCC 6 builds#2979

Merged
kilograham merged 10 commits into
developfrom
cpp-improvements
Jun 3, 2026
Merged

Some cleanup of C++ support and fix GCC 6 builds#2979
kilograham merged 10 commits into
developfrom
cpp-improvements

Conversation

@kilograham

@kilograham kilograham commented Jun 2, 2026

Copy link
Copy Markdown
Contributor
  • -nostartfiles is now always applied on GCC
  • currently no fini stuff is not called, but C++ code may be included in fini_array (we are probably wasting space; we may want to elide that and/or allow for fini execution)
  • GCC 6 seems to have been broken for some time, as it was using a non thumb/v6m set of libraries (compiled but hardfaulted on execution)
  • llvm libc C++ support seemed a bit behind the times, but now seems to work OK
  • Added support for thread safe static init (controlled via PICO_CXX_THREAD_SAFE_STATIC_INIT)
  • Added PICO_CONFIG for PICO_CXX_ options to new pico/cxx_options.h
  • ^ actually it works fine except when built from bazel in which case we get unsatisfied link errors with new/delete for std::vector

* -nostartfiles is now always applied on GCC
* currently no fini stuff is not called, but C++ code may be included in fini_array (we are probably wasting space; we may want to elide that and/or allow for fini execution)
* GCC 6 seems to have been broken for some time, as it was using a non thumb/v6m set of libraries (compiled but hardfaulted on execution)
* llvm libc C++ support seemed a bit behind the times, but now seems to work ok (added atomic guard code for static initializers too)
* ^ actually it works fine except when built from bazel in which case we get unsatisfied link errors with new/delete for std::vector
@kilograham kilograham requested a review from will-v-pi June 2, 2026 23:38
@kilograham

Copy link
Copy Markdown
Contributor Author

fixes #1368

Comment thread src/rp2_common/pico_cxx_options/include/pico/cxx_options.h Outdated
Comment thread test/kitchen_sink/BUILD.bazel
@kilograham kilograham requested a review from will-v-pi June 3, 2026 17:22
Comment thread src/rp2_common/pico_cxx_options/new_delete.cpp
Comment thread test/kitchen_sink/BUILD.bazel Outdated
Comment thread test/kitchen_sink/BUILD.bazel Outdated
Comment thread src/rp2_common/pico_cxx_options/include/pico/cxx_options.h Outdated
kilograham and others added 4 commits June 3, 2026 12:31
Co-authored-by: Andrew Scheller <lurch@durge.org>
Co-authored-by: Andrew Scheller <lurch@durge.org>
@kilograham kilograham merged commit 6685d00 into develop Jun 3, 2026
14 checks passed
@kilograham kilograham deleted the cpp-improvements branch June 3, 2026 17:53
@lurch lurch added the c++ label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants